from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

# prompt弹窗

driver = webdriver.Firefox()
driver.get('file:///D:/qq/prompt.html')
driver.maximize_window()
sleep(2)
driver.find_element(By.ID, 'button').click()
sleep(5)
# 弹窗输入框输入信息
alert = driver.switch_to.alert
alert.send_keys('file:///D:/qq/prompt.html')
sleep(5)
# 关闭弹窗
alert.accept()
sleep(5)


